//
//  PYShowMediaController.h
//  IHome
//
//   Created by zhujizheng on 2020/2/18.
//  Copyright © 2019年 com.zhujizheng. All rights reserved.
//

#import "PYViewController.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, PYShowImageType) {
    PYShowImageTypeNone = 0,
};

@class PYShowMediaCell, PYMediaInfo;

@interface PYShowMediaController : PYViewController <UICollectionViewDelegate, UICollectionViewDataSource, UIViewControllerTransitioningDelegate>

/**
 初始化
 
 @param dataArray 初始时的图片数组
 @param index 当前显示第几张图片
 @return self
 */
+ (instancetype)controllerWithArray:(NSArray *)dataArray index:(NSUInteger)index;

@property (nonatomic, assign) PYShowImageType type;
@property (nonatomic, assign, readonly) NSUInteger index;
@property (nonatomic, strong, readonly) UIPageControl *pageControl;
@property (nonatomic, strong, readonly) NSMutableArray *dataArray;

- (void)singleTap;
/// dismiss退出图片浏览，不使用手势控制的自定义动画
- (void)dismissWithoutCustomAnimation;
/// 滚动到指定页
- (void)scrollToIndex:(NSUInteger)index;
/// 滚动时改变index
- (void)indexValueChangedByScroll:(NSUInteger)index;

/**
 更新图片数组
 
 @param dataArray 图片数组，新数据
 @param index 当前显示第几张图片
 */
- (void)reloadWithDataArray:(NSArray *)dataArray index:(NSUInteger)index;


/**
 获取当前显示的cell
 
 @return image
 */
- (nullable PYShowMediaCell *)getCurrentCell;
/**
 获取当前显示的图片
 
 @return image
 */
- (nullable UIImage *)getCurrentImage;

/**
 获取当前显示的图片对应的模型
 
 @return 七牛图片模型
 */
- (nullable PYMediaInfo *)getCurrentModel;

- (BOOL)needPageControl;
- (void)longPressAction;
- (BOOL)isPush;

+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

@end

NS_ASSUME_NONNULL_END
